﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenuProduct.ascx.cs" Inherits="KimSoft.UI.Controls.MenuProduct" %>
<%@ Import Namespace="BLL.Store" %>
<%@ Import Namespace="DTO" %>
<%@ Import Namespace ="System.Collections.Generic"  %>
<link rel="stylesheet" type="text/css" href="<%=Globals.ApplicationPath%>css/ddsmoothmenu.css" />
<link rel="stylesheet" type="text/css" href="<%=Globals.ApplicationPath%>css/ddsmoothmenu-v.css" />
<script type="text/javascript" src="<%=Globals.ApplicationPath%>js/jquery.min.js"></script>
<script type="text/javascript" src="<%=Globals.ApplicationPath%>js/ddsmoothmenu.js"></script>
<script type="text/javascript">
    ddsmoothmenu.init({
        mainmenuid: "smoothmenu", //Menu DIV id
        orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
        classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
        //customtheme: ["#804000", "#482400"],
        contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
</script>

<div class="title">danh nục sản phẩm</div>
<div class="body">
    <div id="smoothmenu" class="ddsmoothmenu-v">
        <ul>
        <%
            List<Department> Dep = Department.ListDepartmentsParent();
        foreach (Department recordDep in Dep)
        { 
            if (Dep.Count > 0) 
            {
                string recordDepUrl = Globals.ApplicationPath + "category/" + recordDep.ID + "_" + Utils.ConvertToUnSign(recordDep.Title).ToLower();
                %>          
                <li> 
                   <a href='<%=recordDepUrl%>'> <%=recordDep.Title%>
                        <asp:Image runat="server" ID="imgDot" ImageUrl="../Images/navigation.png" ImageAlign="Left"/>
                   </a>
                            
                <%
                List<Department> Dep1 = Department.ListDepartmentsByParentID(recordDep.ID);
                if (Dep1.Count > 0)
                {%>
                    <ul>
                   <% foreach (Department recordDep1 in Dep1)
                    {
                        string recordDep1Url = Globals.ApplicationPath + "category/" + recordDep1.ID + "_" + Utils.ConvertToUnSign(recordDep1.Title).ToLower();
                        %>
                      
                          <li><a id='<%=recordDep1.ID %>' href='<%=recordDep1Url %>'><%=recordDep1.Title%>
                              <asp:Image runat="server" ID="imgDot1" ImageUrl="../Images/navigation.png" ImageAlign="Left"/>
                          </a>


                              <%
                                List<Department> Dep2 = Department.ListDepartmentsByParentID(recordDep1.ID);
                                if (Dep2.Count > 0)
                                {%>
                                    <ul>
                                   <% foreach (Department recordDep2 in Dep2)
                                    {
                                        string recordDep2Url = Globals.ApplicationPath + "category/" + recordDep2.ID + "_" + Utils.ConvertToUnSign(recordDep2.Title).ToLower();
                                        %>
                      
                                          <li><a id='<%=recordDep2.ID %>' href='<%=recordDep2Url %>'><%=recordDep2.Title%>
                                              <asp:Image runat="server" ID="imgDot2" ImageUrl="../Images/navigation.png" ImageAlign="Left"/>
                                          </a></li>
                      
                                <%  } %>
                                    </ul>
                                <%
                                } %>

                          </li>
                      
                <%  } %>
                    </ul>
                <%
                } %>
                </li>
         <% }
        } %>
         </ul>
    </div>
</div>
<div class="bottom"></div>